<?php

namespace App\Models\Behavior;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Image extends Model
{
    use SoftDeletes;

    protected $table = 'love_behavior_images';

    const UPDATED_AT = null;

    public static function options()
    {
        $data = static::select(['url','id'])->get()->toArray();

        $row = [];
        foreach ($data as $key=>$val){
            $row[$val['id']] = "<img style='width:50px;' src='". config('admin.domain') . '/uploads/' . $val['url']."'>";
        }

        return $row;
    }

}
